export default class Score extends Laya.Script {
    // 更多参数说明请访问: https://ldc2.layabox.com/doc/?nav=zh-as-2-4-0
    score=0;
    owner=this.owner as Laya.Sprite
    constructor() { super(); }

    onAwake(){
        Laya.stage.on("start",this,function(){this.score=0;this.owner.text="得分:"+this.score;})
        Laya.stage.on("Addscre",this,this.AddScore)
    }
    AddScore(score=1){
        this.score+=score;
        this.owner.text="得分:"+this.score;
        }
}